/**
 * 
 */
package com.jiang.handler;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 * @author Administrator
 *
 */
public class BookSaxHandler extends DefaultHandler {

	public BookSaxHandler() {
	}

	@Override
	public void startDocument() throws SAXException {

		System.out.println("开始读取文档!");
	}

	@Override
	public void endDocument() throws SAXException {

		System.out.println("文档读取结束");
	}

	@Override
	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
		System.out.println("现在开始读取的元素是:qName=" + qName + ",localName="+localName+",uri="+uri);
	
	}

	@Override
	public void endElement(String uri, String localName, String qName) throws SAXException {

		System.out.println("读取元素结束:qName=" + qName+",localName="+localName+",uri=" + uri);
	}

	@Override
	public void characters(char[] ch, int start, int length) throws SAXException {

		System.out.println("文本内容:" + new String(ch, start, length));
	}

}
